package com.ch06.service.impl;

import com.ch06.entity.User;
import com.ch06.exception.LoginException;
import com.ch06.service.AuthService;
import org.springframework.stereotype.Service;

/**
 * @ClassName AuthServiceImpl
 * @Description TODO
 * @Author Kx
 * @Date 2025/5/13 11:55
 * @Version 1.0
 */
@Service
public class AuthServiceImpl implements AuthService {
    @Override
    public User getUser(String account, String password) {
        if ("admin".equals(account) && "admin".equals(password)) {
            User user = new User();
            user.setUsername("admin");
            user.setPassword("admin");
            return user;
        }
        throw new LoginException(1001,"账号或密码错误");
    }
}
